#!/bin/sh
set -o errexit

rm -rf go
wget -O go.tar.gz https://studygolang.com/dl/golang/go1.23.3.linux-amd64.tar.gz
tar -xvzf go.tar.gz
sudo rm -rf /usr/local/go
sudo rm -rf /usr/local/bin/gofmt
sudo rm -rf /usr/local/bin/go
sudo mv go /usr/local/
sudo ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
go env -w GO111MODULE=on
go env -w GOPATH="/home/${USER}/gopath"
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GOSUMDB=off
rm go.tar.gz
